<?php
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=DR.doc");
?>
<html>
	<head>
		<title></title>
	</head>
<body>
<table style="width: 960px; border: 1px solid #000;">

	<tr>
		<td>
		<!--- FIRST ROW-->
			<table style="width: 100%;" cellpadding="5px">
				<tr>
					<td style="width: 33%;" valign="top">
						<img src="https://stormbenefits.com/wp-content/themes/Storm_Benefits/images/logo_03.png" class="img-responsive center-block">
					</td>
					<td style="width: 33%;" valign="top">
					<strong>STORM FLEX SYSTEMS INC.</strong> <br />
					Unit 602 Centerpoint Building	J. Vargas Ave <br />
					 Ortigas Center, Pasig City	<br />
					 Tel/Fax No. 654-3136 <br />
					 Tin: 008-458-000-000 VAT <br />					
					</td>
					<td style="width: 33%;"  valign="top">
						<table style="width: 100%;" cellpadding="10px">
							<tr>
								<td style="background: #000; color: FFF; text-align: center;">DELIVERY RECEIPT</td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	
	<tr>
			<td><table	style="width: 100%; border-collapse: collapse;"  border="1"  cellpadding="5px ">
					<tr >
						<td style="text-align: center; width: 33% border: 1px solid #000; font-weight: bold; " >Company Name</td>
						<td style="text-align: center; width: 33% border: 1px solid #000;font-weight: bold;  " >Delivery Date</td>
						<td style="text-align: center; width: 33% border: 1px solid #000; font-weight: bold; " >Delivery Receipt No.</td>
					</tr>
					<tr >@foreach($generate_dr as $value)
						<td style="text-align: center; width: 33% border: 1px solid #000; height: 40px;" >{{ $value->name }}</td>
						<td style="text-align: center; width: 33% border: 1px solid #000; height: 40px;" > </td>
						<td style="text-align: center; width: 33% border: 1px solid #000; height: 40px;" >Under Construction</td>
						@endforeach
					</tr>
					<tr >
						<td style="text-align: center; width: 70% border: 1px solid #000; font-weight: bold; " >Contact Person</td>
						<td style="text-align: center; width: 30% border: 1px solid #000;font-weight: bold; " colspan="2" >Address</td>
						
					</tr>
					<tr >
					@foreach($generate_dr as $value)
						<td style="text-align: center; width: 70% border: 1px solid #000; height: 40px;" >{{ $value->lastname }} {{ $value->firstname }}</td>
						<td style="text-align: center; width: 30% border: 1px solid #000; height: 40px;" colspan="2";  >{{ $value->address }}</td>
					@endforeach
					</tr>
				</table>

			</td>
			
	</tr>	
	<tr style="height:15px;"></tr>
	<tr >
		<td> <table style="width: 100%; border-collapse: collapse;"  border="1"  cellpadding="5px">
					<tr>
						<td style="text-align: center; width: 10%; border: 1px solid #000; font-weight: bold; ">QTY</td>
						<td style="text-align: center; width: 55%; border: 1px solid #000; font-weight: bold; ">DESCRIPTION</td>
						<td style="text-align: center; width: 45%; border: 1px solid #000; font-weight: bold; ">OPTIONS</td>
					</tr>
					<tr>
						@foreach($generate_dr as $value)
						<td style="text-align: center; width: 20%; border: 1px solid #000; height: 60px;">{{ $value->quantity }}</td>
						<td style="text-align: center; width: 50%; border: 1px solid #000; height: 60px;">{{ $value->product_name }} -{{ $value->name }}- {{ $value->id}}</td>
						<td style="text-align: center; width: 30%; border: 1px solid #000; height: 60px;">{{ $value->option_value }} {{ $value->price }}</td>
						@endforeach
					</tr>
				</table>
		</td>
	</tr>
	
	<tr style="height:15px;"></tr>
	
	<tr>
		<td >
				<table style="width: 100%; border: 1px solid #000;">
						<tr>
						<td style="font-style: italic; vertical-align: top; height: 80px; width:100%; padding-left: 10px;">Remarks</td>
						</tr>
				</table>
		</td>
	</tr>
	
<tr style="height:15px;"></tr>

	<tr>
		<td>
		<!--- LAST ROW-->
			<table style="width: 100%; border-collapse: collapse;"  border="1px solid #000" cellpadding="5px">
				<tr>
					<td style="width: 50%;">
						<table style="border: 1px solid #000; border-collapse: collapse; text-align: center; width: 100%; ">
							<tr>
								<td style="text-align: center; width: 33%; border: 1px solid #000; font-weight: bold;">
									Prepared By:
								</td>
								<td style="text-align: center; width: 33%; border: 1px solid #000; font-weight: bold;">
									Release By:
								</td>
								<td style="text-align: center; width: 33%; border: 1px solid #000; font-weight: bold;">
									Approved By:
								</td>
							</tr>
							<tr>
								<td style="text-align: center; width: 33%; height:190px; border: 1px solid #000;">
								{{ Auth::user()->firstname }}
								</td>
								<td style="text-align: center; width: 33%; border: 1px solid #000;">
									
								</td>
								<td style="text-align: center; width: 33%; border: 1px solid #000;">
								@if( Auth::user()->userGroup->level == Constant::USER_MANAGER )
								 {{ Auth::user()->firstname }}
								@endif
								</td>
							</tr>
							<tr>
								<td style="text-align: center; width: 33%; border: 1px solid #000; font-weight: bold;">
									Date
								</td>
								<td style="text-align: center; width: 33%; border: 1px solid #000; font-weight: bold;">
									Date
								</td>
								<td style="text-align: center; width: 33%; border: 1px solid #000; font-weight: bold;">
									Date
								</td>
							</tr>
							<tr>
								<td style="vertical-align: bottom; text-align: center; width: 33%; height:65px; border: 1px solid #000;">
									{{ date("d-M-y") }}
								</td>
								<td style="vertical-align: bottom; text-align: center; width: 33%; height:65px; border: 1px solid #000;">
								
								</td>
								<td style="vertical-align: bottom; text-align: center; width: 33%; height:65px; border: 1px solid #000;">
								@if( Auth::user()->userGroup->level == Constant::USER_MANAGER )
								 {{ date("d-M-y") }}
								@endif
								</td>
							</tr>
						</table>
					</td>
					<td style="width: 50%; font-weight: bold; margin-left: 10px; font-size: 12px; " >&nbsp;&nbsp;RECEIVED ABOVE PRODUCTS IN GOOD ORDER AND CONDITION
							<table style="width: 98%; border: 1px solid #000; border-collapse: collapse; font-size: 12px;" cellpadding="10px">
							<tr>
								<td style="padding-left: 10px; font-style: italic; width: 100%; height: 60px; border: 1px solid black; "> PRINTED NAME</td>
							</tr>
							<tr>
							<td style="padding-left: 10px; font-style: italic; width: 100%; height: 60px; border: 1px solid black; "> SIGNATURE</td>
							</tr>
							<tr> 
							<td style="padding-left: 10px; font-style: italic; width: 100%; height: 60px; border: 1px solid black; ">DATE RECEIVED</td>
							</tr>
							</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>

</table>
</body>
</html>